/*
 * Project it.battlehorse.rcp.sl
 * Created on Apr 9, 2006
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * A copy of the LGPL is available also at
 * http://www.gnu.org/copyleft/lesser.html
 * 
 */ 
package it.battlehorse.rcp.sl.annot;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation is used to tags the methods of a {@link Serviceable} object. The Service locator will
 * inject dependencies into {@code Serviceable} objects by invocation of all the methods which are tagged
 * with this annotation. Dependencies are represented in the form of method parameters.
 * <p>
 * Dependencies can be optional. Optional dependencies will not raise exceptions if the Service locator is
 * unable to satisfy them.
 * 
 * @author Riccardo "battlehorse" Govoni [battlehorse@gmail.com]
 * @since Apr 9, 2006
 */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Injected {
	
	/**
	 * Returns whether the injection of the dependencies is optional or not
	 *  
	 * @return whether the injection of the dependencies is optional or not
	 */
	boolean optional() default false;

}
